if (candidateContent) {
content = candidateContent.copy(params.monitorIndex, params.effects);
+ if (params.cancellable && params.cancellable.is_cancelled())
+ content = NULL;
+
if (params.onFinished)
params.onFinished(content);
} else {
_destroy: function() {
this._cancellable.cancel();
- this._cancellable = null;
if (this._animationUpdateTimeoutId) {
GLib.source_remove (this._animationUpdateTimeoutId);
onLoaded: Lang.bind(this, function(animation) {
this._animation = animation;
- if (!this._animation) {
+ if (!this._animation || this._cancellable.is_cancelled()) {
this._setLoaded();
return;
}
cancellable: this._cancellable,
onFinished: Lang.bind(this, function(content) {
if (!content) {
- if (this._cancellable &&
- !this._cancellable.is_cancelled())
+ if (!this._cancellable.is_cancelled())
this._loadAnimation(filename);
return;
}